package panda.log;

import panda.file.Page;

public class BasicLogRecord {
	private Page page;

	private int position;
	
	public BasicLogRecord(Page page, int position) {
		this.page = page;
		this.position = position;
	}
	
	public int getInt(){
		int returnValue=page.getInt(position);
		position+=Page.INT_SIZE;
		return returnValue;
	}
	
	public String getString() {
		String returnValue = page.getString(position);
		position += Page.STR_SIZE(returnValue);
		return returnValue;
	}
	
	public float getFloat(){
		float returnValue=page.getFloat(position);
		position+=Page.FLOAT_SIZE;
		return returnValue;
	}
	
	public long getLong(){
		long returnValue=page.getLong(position);
		position+=Page.LONG_SIZE;
		return returnValue;
	}
	
	public byte[] getArray(){
		byte[] returnValue=page.getArray(position);
		position+=Page.ARRAY_SIZE(returnValue);
		return returnValue;
	}
}
